{include file='public/header.html'}

<div class="aphp-msg container mtn">

    <div class="msg-header clearfix">
        <span class="pull-left">
            留言ID：{$vo.id} {if $vo['status']==0:}<span class="text-danger">[待审核]</span>{/if}
        </span>
        <span class="pull-right">
        {if !session('user.id'):}
          <a href="{:url('user/login')}">登录</a>
        {else:}
          <a href="{:url('user/index')}">管理</a> | <a href="{:url('user/profile')}">资料</a> | <a href="{:url('user/password')}">改密</a> | <a href="javascript:ajaxConfirm('{:url('user/logout')}','退出');">退出</a>
        {/if}
        </span>
    </div>

    <div class="media">
        {if $vo['status']==1 || session('user.level')>1:}
        <div class="media-left media-top">
            {if empty($vo['qq']):}
            <img src="__STATIC__/img/avatar.png" class="media-object" alt="avatar"/>
            {else:}
            <img src="http://q1.qlogo.cn/g?b=qq&nk={$vo.qq}&s=100&t={:time()}" title="QQ{$vo.qq}" class="media-object" alt="avatar"/>
            {/if}
        </div>
        <div class="media-body">
            <div class="media-heading">
                <span class="user">网友：{if $vo['uid']>0:}<a href="{:url('user/info',['id'=>$vo['uid']])}">{$vo.nickname}</a>{else:}{$vo.nickname}{/if}</span> <span class="time">时间：{$vo.create_time|get_time_ago}</span>
                <span class="pull-right"><a href="javascript:history.back(-1);">返回</a></span>
            </div>
            <div class="media-content">
                <h5><a href="{:url('message/detail',['id'=>$vo['id']])}">{$vo.title}</a> {if $vo['is_top']==1:}<span class="text-danger">[置顶]</span>{/if}</h5>
                <p>{$vo.msg}</p>
                {if !empty($vo['reply_msg']):}
                <div class="reply">&nbsp;&nbsp;<strong><a href="{:url('user/info',['id'=>$vo['reply_uid']])}">{$vo.reply_nickname}</a> 于 {$vo.reply_time|get_time_ago} 回复</strong>：{$vo.reply_msg}</div>
                {/if}
                {if session('user.level')>1:}
                <div id="reMsg-id{$vo.id}" style="display:none;">
                    <form method="post" class="form-inline submit-ajax" action="{:url('message/reply')}">
                        <input type="hidden" name="id" value="{$vo.id}"/>
                        <div class="form-group">
                            <input type="text" name="reply_msg" class="form-control" placeholder="请输入回复内容..." value="{$vo.reply_msg}"/>
                        </div>
                        <button class="btn btn-primary">回复</button>
                    </form>
                </div>
                {/if}
            </div>
            <div class="media-footer">
                <span class="pull-left address">
                    {$vo.ip|ip_format}
                    {if session('user.level')>1:} |
                    <a href="javascript:;" onclick="$('#reMsg-id{$vo.id}').toggle();" title="回复留言">回复</a> |
                    <a href="javascript:ajaxConfirm('{:url('message/top',['id'=>$vo['id']])}','设置置顶',2);">置顶</a> |
                        {if $vo['status']==0:}
                        <a href="javascript:ajaxConfirm('{:url('message/audit',['id'=>$vo['id']])}','通过审核',2);" class="text-danger">通过审核</a>
                        {else:}
                        <a href="javascript:ajaxConfirm('{:url('message/del',['id'=>$vo['id']])}','设为待审',2);">设为待审</a>
                        {/if}
                    {/if}
                </span>
                <span class="pull-right">
                    <a class="like" href="javascript:ajaxGet('{:url('message/poll',['id'=>$vo['id']])}',2);">赞（{$vo.poll_count}）</a>
                </span>
            </div>
        </div>
        {else:}
        <div class="media-left media-top">
            <img src="__STATIC__/img/avatar.png" class="media-object" alt="avatar"/>
        </div>
        <div class="media-body">
            <p style="color:#999;">{$vo.nickname|str_substr=2} {$vo.create_time|get_time_ago} 留言</p>
            <span style="color:#999;">待审核...</span>
        </div>
        {/if}
    </div>

</div>
{include file='public/footer.html'}
</body>
</html>